/**
*	@file		assert.h 
*	@version	1.0a
*	@author		rpvaras
*
*	This file is part of omcpp.
*	
*	
*
*	omcpp is free software: you can redistribute it and/or modify
*	it under the terms of the GNU General Public License as published by
*	the Free Software Foundation, either version 3 of the License, or
*	(at your option) any later version.
*
*	omcpp is distributed in the hope that it will be useful,
*	but WITHOUT ANY WARRANTY; without even the implied warranty of
*	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*	GNU General Public License for more details.
*
*	You should have received a copy of the GNU General Public License
*	along with omcpp. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __assert_h__
#define __assert_h__ 1

#include <omcpp/config.h>

#ifdef OMCPP_ASSERT_EXCEPTION
#include <exception>
#endif 

#define omcpp_break _asm { int 3 }
#define omcpp_throw_assert throw std::exception("Assertion Failed");

#ifdef OMCPP_ASSERT_EXCEPTION
#define omcpp_assert(condition) if(!(condition)) { omcpp_throw_assert; }
#else
#define omcpp_assert(condition) if(!(condition)) { omcpp_break; }
#endif

#endif //__assert_h__